/**
 * Created by Mark_ren on 2017/5/23.
 * 今天心情不好，可能是因为阴天。
 */
var moment = require("moment");
var co = require('co');
var seqModule = require('../../../routes/createModules');
var seq = new seqModule();
var util = require('../../../common/util');

var sortClickLogController = {

    /**
     *  增加点击记录
     * @param req
     * @param res
     */
    addSortClickLog: function (req, res) {
        co(function () {
            var uuid =util.getUUID();
            req.body.id = uuid;
            req.body.parentId = req.query.parentId;
            req.body.sortId = req.query.sortId;
            req.body.memberId = req.query.memberId;
            req.body.openId = req.query.openId;
            req.body.ForwardMember = req.query.ForwardMember;
            req.body.createTime=moment().format("YYYY-MM-DD HH:mm:ss");
            seq.sortClickLogModule.create(req.body).then(function(result){
                res.status(200).json({
                    success:true,
                    message: "添加成功",
                    result:result
                });
            })
        }).catch(function (e) {
            res.json({ 'success': false, 'msg': '新增失败' });
            console.log(e);
        })

    }
}
module.exports = sortClickLogController;